package com.jzo2o.orders.manager.hander;

import cn.hutool.extra.spring.SpringUtil;
import com.jzo2o.orders.base.model.domain.Orders;
import com.jzo2o.orders.manager.model.dto.request.PlaceOrderReqDTO;
import com.jzo2o.orders.manager.service.IOrdersCreateService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: lzj
 * 保存订单处理类
 *
 */
@Slf4j
public class SavaOrderHandler extends OrderHandler{
    private IOrdersCreateService ordersCreateService;
    public SavaOrderHandler() {
        this.ordersCreateService = SpringUtil.getBean(IOrdersCreateService.class);
    }

    @Override
    public void process(Orders orders, PlaceOrderReqDTO reqDTO) {
      log.info("保存订单处理");
      ordersCreateService.save(orders);
      orderHandler.process(orders, reqDTO);
    }
}
